package com.fdb.efp.console.api.rest;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.irdstudio.efp.console.service.facade.PrdPiccsBanceMapService;
import com.irdstudio.efp.console.service.vo.PrdPiccsBanceMapVO;
import com.irdstudio.basic.framework.core.constant.ResponseData;
import com.irdstudio.basic.framework.web.controller.AbstractController;

@RestController
@RequestMapping("/api")
public class PrdPiccsBanceMapController extends AbstractController  {
	
	@Autowired
	@Qualifier("prdPiccsBanceMapService")
	private PrdPiccsBanceMapService prdPiccsBanceMapService;

	
	/**
	 * 列表数据查询
	 * @param page
	 * @param size
	 * @return
	 */
	@RequestMapping(value="/prd/piccs/bance/maps", method=RequestMethod.POST)
	public @ResponseBody ResponseData<List<PrdPiccsBanceMapVO>> queryPrdPiccsBanceMapAll(
			@RequestBody PrdPiccsBanceMapVO vo) {		
		List<PrdPiccsBanceMapVO> outputVo = prdPiccsBanceMapService.queryAllOwner(vo);
		return getResponseData(outputVo);
		
	}
	
	/**
	 * 根据主键查询详情
	 * @return
	 */
	@RequestMapping(value="/prd/piccs/bance/map/{serno}", method=RequestMethod.GET)
	public @ResponseBody ResponseData<PrdPiccsBanceMapVO> queryByPk(@PathVariable("serno") String serno) {		
		PrdPiccsBanceMapVO inVo = new PrdPiccsBanceMapVO();
				inVo.setSerno(serno);
		PrdPiccsBanceMapVO outputVo = prdPiccsBanceMapService.queryByPk(inVo);
		return getResponseData(outputVo);
		
	}
	
	/**
	 * 根据主键删除信息
	 * @param prdPiccsBanceMap
	 * @return
	 */
	@RequestMapping(value="/prd/piccs/bance/map", method=RequestMethod.DELETE)
	public @ResponseBody ResponseData<Integer> deleteByPk(@RequestBody PrdPiccsBanceMapVO inPrdPiccsBanceMapVo) {		
		int outputVo = prdPiccsBanceMapService.deleteByPk(inPrdPiccsBanceMapVo);
		return getResponseData(outputVo);
		
	}
	
	/**
	 * 根据主键更新信息
	 * @param inPrdPiccsBanceMapVo
	 * @return
	 */
	@RequestMapping(value="/prd/piccs/bance/map", method=RequestMethod.PUT)
	public @ResponseBody ResponseData<Integer> updateByPk(@RequestBody PrdPiccsBanceMapVO inPrdPiccsBanceMapVo) {		
		int outputVo = prdPiccsBanceMapService.updateByPk(inPrdPiccsBanceMapVo);
		return getResponseData(outputVo);
		
	}
	
	/**
	 * 新增数据
	 * @param inPrdPiccsBanceMapVo
	 * @return
	 */
	@RequestMapping(value="/prd/piccs/bance/map", method=RequestMethod.POST)
	public @ResponseBody ResponseData<Integer> insertPrdPiccsBanceMap(@RequestBody PrdPiccsBanceMapVO inPrdPiccsBanceMapVo) {
		int outputVo = prdPiccsBanceMapService.insertPrdPiccsBanceMap(inPrdPiccsBanceMapVo);
		return getResponseData(outputVo);
		
	}
}
